package Campus.help.user.controller;


import Campus.help.common.utils.R;
import Campus.help.user.entity.MaintenanceWorkerInfo;
import Campus.help.user.service.MaintenanceWorkerInfoService;
import Campus.help.user.vo.WorkerInfoVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author haoyun.xiong
 * @since 2023-05-09
 */
@RestController
@RequestMapping("/user/maintenanceWorkerInfo")
public class MaintenanceWorkerInfoController {

    @Autowired
    private MaintenanceWorkerInfoService workerInfoService;
    @PutMapping("addWokerInfo")
    @ApiOperation("增加员工账号")
    public R addWokerInfo(@RequestBody WorkerInfoVo vo){
        return workerInfoService.addWokerInfo(vo);
    }

    @PostMapping("updateWokerInfo")
    @ApiOperation("修改员工账号")
    public R updateWokerInfo(@RequestBody MaintenanceWorkerInfo vo){
        return workerInfoService.updateWokerInfo(vo);
    }
    @GetMapping("getWokerInfo")
    @ApiOperation("获取员工信息")
    public R getWokerInfo(){
        return workerInfoService.getWokerInfo();
    }

    @PostMapping("delWorder")
    @ApiOperation("删除员工信息")
    public R delWokerInfo(@RequestParam("worderId")Long id){
        return workerInfoService.delWokerInfo(id);
    }
}

